package com.penghk.springbootdemo.service.impl;

import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Service
@Data
public class DemoService {
    private Logger logger = LoggerFactory.getLogger(DemoService.class);

    /**
     *
     */
    @Value("another")
    private String another;

    @PostConstruct
    public void init() {
        System.out.println("init bean");
    }

    @PreDestroy
    public void des() {
        System.out.println("destory");
    }

    public void demo() {
        logger.error("hello wlrd");
        System.out.println("hello world");
        System.out.println("hello world");
        System.out.println("hello world");
    }
}
